package BanyuanClub.Study.Day0304;

import java.io.FileNotFoundException;
import java.io.FileReader;
import java.io.IOException;

/**
 * 字符输出流
 */
public class TextFileReader {
    public static void main(String[] args) {

    try (FileReader fr = new FileReader("src.txt")){
        char[] ch = new char[8];
        int end;
        StringBuilder s = new StringBuilder();
        while ((end = fr.read(ch)) != -1){
            s.append(String.valueOf(ch,0,end));
        }
        System.out.println(s);
    } catch (FileNotFoundException e) {
        e.printStackTrace();
    } catch (IOException e) {
        e.printStackTrace();
    }
    }
}
